<template>
  <Wmodule title="孢子捕捉" class="m5">
    <div class="mmkb">
      <div class="mmkb-child">
        <div class="baozi-list">
          <div
            class="baozi-item"
            v-for="(item, index) in baozilist"
            :key="index"
          >
            <div class="baozi-item-img">
              <img :src="imgUrl12" alt="" class="icon" />
            </div>
            <div class="baozi-item-name">{{ item.statusLabel }}</div>
            <div class="baozi-item-status">{{ item.status }}</div>
          </div>
        </div>
      </div>
    </div>
  </Wmodule>
</template>
<script setup>
import { ref, watch } from 'vue'
import Wmodule from '@/components/wmodule/index.vue'
import imgUrl12 from '@/assets/img/12.png'

const props = defineProps({
  data: {
    type: Array,
    default: () => []
  }
})
const baozilist = ref([])
watch(
  () => props.data,
  (newValue) => {
    console.log('new', newValue)
    baozilist.value = newValue
  },
  {
    immediate: true
  }
)
</script>
<style lang="scss" scoped>
.m5 {
  height: 100%;
}
.mmkb {
  height: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 20px 0;
  box-sizing: border-box;
  .mmkb-child {
    width: 100%;
    min-height: 0px;
    flex: 1;
    overflow: hidden;
    overflow-y: auto;
    &::-webkit-scrollbar {
      width: 0 !important;
    }
  }
}
.baozi-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px 10px;
  .baozi-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: rgba(256, 256, 256, 0.1);
    margin: 0 20px;
    padding: 10px;
    box-sizing: border-box;
    .baozi-item-img {
      display: flex;
      justify-content: center;
      align-items: center;
      .icon {
        width: 12px;
        height: 12px;
        display: block;
      }
    }
    .baozi-item-name {
      font-family: Microsoft YaHei;
      font-weight: 600;
      font-size: 14px;
      color: #ffffff;
      flex: 1;
      margin-left: 8px;
    }
    .baozi-item-status {
      font-family: Microsoft YaHei;
      font-weight: 600;
      font-size: 14px;
      color: #ffffff;
    }
  }
}
</style>
